********************************************************************************
*																			   *
*						Sir! I'd Rather Go to School Sir!					   *
*																			   *
*								 Mahdi Majbouri								   *
*																			   *
*									 Table B3								   *
*																			   *
*									6-6-2023								   *
*																			   *
********************************************************************************


********************
** Job Status
********************

use "census11-all.dta", clear

keep if fage>=fage18 & fage18>=threshold - 9 & fage18<=threshold + 10
keep if urban == 2

replace occ = . if occ>=998
gen job = int(occ/100) if occ>=100

*keep if age >= 22 & age <=28

/*
gen cskill = (job == 9)
replace cskill = 2 if inlist(job, 8, 7, 6, 5)
replace cskill = 3 if inlist(job, 3, 4)
replace cskill = 4 if job == 2
replace cskill = 4 if job == 1
replace cskill = . if job == . 
*/
gen cskill = inlist(job, 1, 2, 3, 4) if job !=.

gen s = (sons==1 & son==1) if sons!=.
replace s = . if relate == 3 & son == 0

gen st = s * t
gen sfa = s * fa
gen stfa = s * t * fa

gen sfasq = s * fasq
gen stfasq = s * t * fasq

gen sfacb = s * facb
gen stfacb = s * t * facb

gen dfa = sfa
replace dfa = 100 *fa if s == 0

drop if school == 1

gen agesq = age * age / 100

gen lfp = (empstat == 1 | empstat == 2)	if empstat != .	
reg lfp t fa tfa if relate==3 & son==1 & sons == 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B3", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("LFP(1)") replace
reg lfp t fa tfa fasq tfasq if relate==3 & son==1 & sons == 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B3", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("LFP(2)") append
reg lfp t fa tfa fasq tfasq facb tfacb if relate==3 & son==1 & sons == 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B3", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("LFP(3)") append	

gen unemployed = (empstat == 2) if lfp == 1
reg unemployed t fa tfa if relate==3 & son==1 & sons == 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B3", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("UNEMP(1)") append
reg unemployed t fa tfa fasq tfasq if relate==3 & son==1 & sons == 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B3", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("UNEMP(2)") append
reg unemployed t fa tfa fasq tfasq facb tfacb if relate==3 & son==1 & sons == 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B3", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("UNEMP(3)") append	

reg cskill t fa tfa if relate==3 & son==1 & sons == 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B3", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("SKILL(1)") append
reg cskill t fa tfa fasq tfasq if relate==3 & son==1 & sons == 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B3", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("SKILL(2)") append
reg cskill t fa tfa fasq tfasq facb tfacb if relate==3 & son==1 & sons == 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B3", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("SKILL(3)") append	
		

gen av_w = 10.331495 if job == 1
replace av_w = 10.085716 if job == 2
replace av_w = 9.7432507 if job  == 3
replace av_w = 9.7092485 if job == 4
replace av_w = 9.4013557 if job == 5
replace av_w = 9.4451785 if job == 6
replace av_w = 9.5111654 if job == 7
replace av_w = 9.5588096 if job == 8
replace av_w = 9.4004441 if job == 9

reg av_w t fa tfa if relate==3 & son==1 & sons == 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B3", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("grossmonthlywage(1)") append
reg av_w t fa tfa fasq tfasq if relate==3 & son==1 & sons == 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B3", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("grossmonthlywage(2)") append
reg av_w t fa tfa fasq tfasq facb tfacb if relate==3 & son==1 & sons == 1 ///
		& fage>=fage18 & urban == 2, vce(cluster fa)
outreg2 using "Table B3", excel adjr2 se alpha(0.01,0.05,0.10) ///
		symbol(***,**,*) bdec(3) sdec(3) rdec(3) ctitle("grossmonthlywage(3)") append	
		
		

********************************************************************************
*********************************  THE END *************************************
********************************************************************************

		